﻿using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Helper
{
    public class FileHandle
    {
        public void insertErrorLogFile(string message,string methodname) 
        {
            string logPath = AppDomain.CurrentDomain.BaseDirectory;
            string TimeStamp = DateTime.Now.ToString();

            using (StreamWriter writer = new StreamWriter(logPath + "\\ErrorLog\\ErrorLogActivities.txt", true))
            {
                string ErrorMessage = String.Format(@"TIME: {2} :: METHOD: {1} :: ERROR: {0} ;", message, methodname, TimeStamp);
                writer.WriteLine(ErrorMessage);
                string saperateLine = "//___________________________________________//";
                writer.WriteLine(saperateLine);

            }
        }
    }
}
